package cn.kgc.rbac.common;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author: mosin
 * @version: v1.0  2023/1/30
 * 统一响应结果格式
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ResponseResult {

    private String msg;
    private Integer code;  //  0  成功
    private Object data;
    private Long count;


    public ResponseResult(){}

    public ResponseResult(CodeMsg codeMsg){
        this.code = codeMsg.getCode();
        this.msg = codeMsg.getMsg();
    }

    public ResponseResult(CodeMsg codeMsg,Object data,Long count){
       this(codeMsg);
       this.data = data;
       this.count = count;
    }

}
